<template>
  <el-icon class="collapse-icon" @click="changeCollapse">
    <component :is="useGlobal.globalConfig.isCollapse ? 'expand' : 'fold'"></component>
  </el-icon>
</template>

<script setup lang="ts">
import { useGlobalStore } from "@/stores";

defineOptions({
  name: "CollapseIcon"
});

const useGlobal = useGlobalStore();
const changeCollapse = () => (useGlobal.globalConfig.isCollapse = !useGlobal.globalConfig.isCollapse);
</script>

<style scoped lang="scss">
.collapse-icon {
  margin: 0px 10px;
  font-size: 22px;
  color: var(--el-header-text-color);
  cursor: pointer;
}
</style>
